﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Imagenator
{
	class Settings : ArgusLib.Xml.SerializableSettings
	{
		protected override string SettingsPath { get { return "Settings.xml"; } }

		public Settings()
			:base()
		{
			this.Reset();
		}

		public static Settings Load() { return Settings.Load<Settings>(); }

		public override void Reset()
		{
			this.MainFormBounds = System.Drawing.Rectangle.Empty;
			this.OutputPattern = @"{Y}-{m:2}-{d:2} - {DD}\{y:2}{m:2}{d:2}{h:2}{min:2}{s:2}";
			this.OutputFormat = FreeImageAPI.FREE_IMAGE_FORMAT.FIF_JPEG;
			this.OutputSize = 0;
			this.ResizingAlgorithm = FreeImageAPI.FREE_IMAGE_FILTER.FILTER_BICUBIC;
			this.JpegQuality = Imagenator.JpegQuality.Good;
			this.JpegSubsampling = Imagenator.JpegSubsampling.Default;
			this.ShowPreviewImages = true;
			//this.PreviewImageHeight = 50;
			this.CheckForUpdates = true;
			this.AlwaysConvertImageType = false;
			this.OutputType = FreeImageAPI.FREE_IMAGE_TYPE.FIT_BITMAP;
			this.PngInterlaced = false;
			this.PngCompression = Imagenator.PngCompression.Default;
			this.JpegProgressive = true;
			this.ExrCompression = Imagenator.ExrCompression.Default;
			this.ExrLumaChroma = false;
			this.IconSizes = IcoSizes.None;
			this.ThumbnailSize = new System.Drawing.Size(100, 50);
		}

		public System.Drawing.Rectangle MainFormBounds { get; set; }
		public System.Drawing.Rectangle ImageFormBounds { get; set; }
		public string OutputPattern { get; set; }
		public FreeImageAPI.FREE_IMAGE_FORMAT OutputFormat { get; set; }
		public int OutputSize { get; set; }
		public FreeImageAPI.FREE_IMAGE_FILTER ResizingAlgorithm { get; set; }
		public JpegQuality JpegQuality { get; set; }
		public JpegSubsampling JpegSubsampling { get; set; }
		public bool ShowPreviewImages { get; set; }
		//public int PreviewImageHeight { get; set; }
		public bool CheckForUpdates { get; set; }
		public bool AlwaysConvertImageType { get; set; }
		public FreeImageAPI.FREE_IMAGE_TYPE OutputType { get; set; }
		public bool PngInterlaced { get; set; }
		public PngCompression PngCompression { get; set; }
		public bool JpegProgressive { get; set; }
		public ExrCompression ExrCompression { get; set; }
		public bool ExrLumaChroma { get; set; }
		public IcoSizes IconSizes { get; set; }
		public System.Drawing.Size ThumbnailSize { get; set; }
	}
}
